from telnetlib import DO

import numpy as np
from manimlib import *
from numpy import flip, insert
import math

LV, QL, QH, JH = '#75cfb8', '#bbdfc8', '#f0e5d8', '#ffc478'


class p1(ThreeDScene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        l=VGroup(
            Square(0.2).stretch(10,1).set_fill(LIGHT_BROWN,1),
            Square(0.2).next_to([0,1,0],DOWN,buff=0).set_fill(RED_D,1)
        )
        for i in range(6):
            self.add(l.copy().move_to([-2.5,0,0]).shift(RIGHT*i))

class p2(ThreeDScene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        l=VGroup(
            Square(0.2).stretch(10,1).set_fill(LIGHT_BROWN,1),
            Square(0.2).next_to([0,1,0],DOWN,buff=0).set_fill(RED_D,1)
        )
        for i in range(4):
            self.add(
                l.copy().shift(LEFT).rotate_about_origin(PI/2*i)
            )
        self.add(
            l.copy().rotate(PI/4),
            l.copy().rotate(PI / 4*3),
        )

class p3(ThreeDScene):
    def construct(self):
        # self.camera.frame.save_state()
        # self.add(NumberPlane())
        # self.camera.frame.rotate(13*DEGREES,about_point=[0.0, 0.0, 1.0])
        l=VGroup(
            Square(0.2).stretch(10,1).set_fill(LIGHT_BROWN,1),
            Square(0.2).next_to([0,1,0],DOWN,buff=0).set_fill(RED_D,1)
        )
        for i in range(4):
            self.add(
                l.copy().shift(LEFT/np.sqrt(2)).rotate_about_origin(PI/2*i)
            )
        self.add(
            l.copy().rotate(PI/4),
            l.copy().rotate(PI / 4*3),
        )

